package elijah.base.thread;


import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.concurrent.TimeUnit;


@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Scheduled {

    long fixedDelay() default -1;

    long fixedRate() default -1;

    long initialFlexRate() default 10_000;

    String flexTag() default "";


    long initialDelay() default -1;

    TimeUnit timeUnit() default TimeUnit.MILLISECONDS;

    int scope() default Scope.FRONT;

    @Target({ElementType.FIELD, ElementType.TYPE})
    @Retention(RetentionPolicy.SOURCE)
    @interface Scope {
        int FRONT = 1;
        int ALIVE = 2;
    }
}
